
import { TabsContent } from "@/components/ui/tabs";
import { AssessmentModuleCard } from "./AssessmentModuleCard";
import { BookOpen, Brain, MapPin } from "lucide-react";
import { useRole } from "@/contexts/RoleContext";

interface AssessmentModule {
  id: string;
  title: string;
  description: string;
  icon: React.ReactNode;
  status: 'completed' | 'in-progress' | 'not-started';
  progress: number;
  estimatedTime: string;
  lastCompleted?: string;
  result?: string;
}

const getAssessmentModulesForRole = (role: string): AssessmentModule[] => {
  if (role === 'teacher') {
    return [
      {
        id: "teaching-philosophy",
        title: "Teaching Philosophy Assessment",
        description: "Discover your teaching philosophy and classroom management approach",
        icon: <BookOpen className="w-5 h-5" />,
        status: "completed",
        progress: 100,
        estimatedTime: "15 min",
        lastCompleted: "April 20, 2025",
        result: "Constructivist Educator"
      },
      {
        id: "strengths-discovery", 
        title: "Strengths Discovery",
        description: "Identify your core teaching strengths and educational capabilities",
        icon: <Brain className="w-5 h-5" />,
        status: "completed",
        progress: 100,
        estimatedTime: "20 min",
        lastCompleted: "April 22, 2025",
        result: "Creative Facilitator"
      },
      {
        id: "interest-explorer",
        title: "Interest Explorer",
        description: "Map your educational interests and subject-area preferences",
        icon: <MapPin className="w-5 h-5" />,
        status: "completed",
        progress: 100,
        estimatedTime: "25 min",
        lastCompleted: "April 25, 2025",
        result: "Social-Investigative Profile"
      }
    ];
  } else {
    return [
      {
        id: "learning-style",
        title: "Learning Style Assessment",
        description: "Discover your optimal learning methods and processing preferences",
        icon: <BookOpen className="w-5 h-5" />,
        status: "completed",
        progress: 100,
        estimatedTime: "15 min",
        lastCompleted: "April 20, 2025",
        result: "Visual Learner"
      },
      {
        id: "strengths-discovery", 
        title: "Strengths Discovery",
        description: "Identify your core cognitive strengths and learning capabilities",
        icon: <Brain className="w-5 h-5" />,
        status: "completed",
        progress: 100,
        estimatedTime: "20 min",
        lastCompleted: "April 22, 2025",
        result: "Creative Contributor"
      },
      {
        id: "interest-explorer",
        title: "Interest Explorer",
        description: "Map your academic and personal interests for career guidance",
        icon: <MapPin className="w-5 h-5" />,
        status: "completed",
        progress: 100,
        estimatedTime: "25 min",
        lastCompleted: "April 25, 2025",
        result: "Social-Investigative Profile"
      }
    ];
  }
};

export function AssessmentModules() {
  const { role } = useRole();
  const assessmentModules = getAssessmentModulesForRole(role || 'student');

  return (
    <TabsContent value="modules" className="space-y-4">
      <div className="grid gap-4">
        {assessmentModules.map((module) => (
          <AssessmentModuleCard key={module.id} module={module} />
        ))}
      </div>
    </TabsContent>
  );
}
